package com.bridge.client.bridgedynamcclient.consts;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

public enum BridgeStatusEnum {

    SAVE(0, "待分析"),
    SUBMIT(1, "分析中"),
    FINISH(2, "已完成"),
    FAILED(3, "失败"),
    ;

   private final Integer code;
    private final   String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    private static Map<Integer,String> maps= Arrays.stream(values()).collect(Collectors.toMap(BridgeStatusEnum::getCode, BridgeStatusEnum::getDesc));

    BridgeStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDescByCode(Integer code){
        return maps.get(code);
    }
}
